<?php

namespace App\Transformers\StoreCoupon;

use App\Models\StoreCouponProduct;
use League\Fractal\TransformerAbstract;

class StoreCouponProductTransformer extends TransformerAbstract
{
    public function transform(StoreCouponProduct $data){
        return [
            'id' => $data->id,
            'coupon_id' => $data->coupon_id ?? '',
            'product_id' => $data->product_id ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }

}
